home *** CD-ROM | disk | FTP | other *** search
/ LeeAnne Interactive / Leeanne Interactive.iso / interface.dir / 00013_Script_UI Pushbutton < prev    next >
Text File  |  1999-08-01  |  2KB  |  73 lines

  1. -- Button Pushbutton
  2.  
  3.  
  4. -- behavior library version 1.1
  5. -- a control
  6. property UpCM, DownCM, UpNum, DownNum
  7. property button_active
  8.  
  9.  
  10. on mouseDown me
  11.   set the member of sprite (the spriteNum of me) = member the downCM of me
  12.   set the button_active of me = TRUE
  13. end
  14.  
  15. on mouseUp me
  16.   set the member of sprite (the spriteNum of me) = member the UpCM of me
  17.   set the button_active of me = false
  18. end
  19.  
  20. on mouseEnter me
  21.   if the button_active of me then
  22.     set the member of sprite (the spriteNum of me) = member the DownCM of me
  23.   end if
  24. end  
  25.  
  26. on mouseLeave me
  27.   if the button_active of me then
  28.     set the member of sprite (the spriteNum of me) = member the UpCM of me
  29.   end if 
  30. end
  31.  
  32. on mouseUpOutside me
  33.   -- mouse leave will set the picture to up
  34.   set the button_active of me = false
  35. end
  36.  
  37. ---
  38.  
  39. on beginSprite me
  40.   
  41.   set the UpCM of me = the member of sprite (the spriteNum of me)  
  42.   set the UpNum of me = the number of member UpCM
  43.   
  44.   set the DownNum of me = the number of member DownCM
  45.   
  46.   set the button_active of me = false
  47.   
  48.   -- puppetSprite the spriteNum of me, TRUE
  49. end
  50.  
  51. on endSprite me
  52.   -- puppetSprite the spriteNum of me, FALSE
  53. end
  54.  
  55. on getPropertyDescriptionList
  56.   if the currentspritenum = 0 then 
  57.     set memdefault = 0 
  58.   else
  59.     set memref = the member of sprite the currentspritenum
  60.     set castlibnum = the castlibnum of memref
  61.     set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
  62.   end if
  63.   
  64.   set p_list = [         #DownCM: [ #comment:   "Hilite Image:",                     #format:   #graphic,                    #default:    memdefault ]                  ]
  65.   return p_list  
  66. end
  67.  
  68. on getBehaviorDescription
  69.   return "Makes a sprite work as a pushbutton with automatic highlighting and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & "PARAMETERS:" & RETURN & "ò Hilite Image - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member."  
  70.   
  71. end
  72.  
  73.